package com.daoeping.data;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Usr_workexperience entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "usr_workexperience", catalog = "daoeping")
public class Usr_workexperience implements java.io.Serializable {

	// Fields

	private Integer id;
	private Usr_user usr_user;
	private Bsc_worktype bsc_worktype;
	private Cop_companyinfo cop_companyinfo;
	private Date startDate;
	private Date endDate;
	private String description;
	private Integer salary;
	private Set<Usr_projectexperience> usr_projectexperiences = new HashSet<Usr_projectexperience>(
			0);

	// Constructors

	/** default constructor */
	public Usr_workexperience() {
	}

	/** minimal constructor */
	public Usr_workexperience(Usr_user usr_user, Cop_companyinfo cop_companyinfo) {
		this.usr_user = usr_user;
		this.cop_companyinfo = cop_companyinfo;
	}

	/** full constructor */
	public Usr_workexperience(Usr_user usr_user, Bsc_worktype bsc_worktype,
			Cop_companyinfo cop_companyinfo, Date startDate, Date endDate,
			String description, Integer salary,
			Set<Usr_projectexperience> usr_projectexperiences) {
		this.usr_user = usr_user;
		this.bsc_worktype = bsc_worktype;
		this.cop_companyinfo = cop_companyinfo;
		this.startDate = startDate;
		this.endDate = endDate;
		this.description = description;
		this.salary = salary;
		this.usr_projectexperiences = usr_projectexperiences;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id", nullable = false)
	public Usr_user getUsr_user() {
		return this.usr_user;
	}

	public void setUsr_user(Usr_user usr_user) {
		this.usr_user = usr_user;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "worktype_id")
	public Bsc_worktype getBsc_worktype() {
		return this.bsc_worktype;
	}

	public void setBsc_worktype(Bsc_worktype bsc_worktype) {
		this.bsc_worktype = bsc_worktype;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "corp_id", nullable = false)
	public Cop_companyinfo getCop_companyinfo() {
		return this.cop_companyinfo;
	}

	public void setCop_companyinfo(Cop_companyinfo cop_companyinfo) {
		this.cop_companyinfo = cop_companyinfo;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "start_date", length = 10)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "end_date", length = 10)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Column(name = "description", length = 1000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "salary")
	public Integer getSalary() {
		return this.salary;
	}

	public void setSalary(Integer salary) {
		this.salary = salary;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "usr_workexperience")
	public Set<Usr_projectexperience> getUsr_projectexperiences() {
		return this.usr_projectexperiences;
	}

	public void setUsr_projectexperiences(
			Set<Usr_projectexperience> usr_projectexperiences) {
		this.usr_projectexperiences = usr_projectexperiences;
	}

}